Skip to content

plugin list: skip Qt diagnostics printed ahead of the payload - #15900

Closed
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:fix-plugin-list-locale-preamble
Closed

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:fix-plugin-list-locale-preamble

Conversation

@AnPod

@AnPod AnPod commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Problem

Since Qt 6.12, the qs ipc client prints Qt's non-UTF-8 locale warning on stdout (nothing goes to stderr), so every omarchy-shell shell listPlugins call in a non-UTF-8 session carries the warning lines ahead of the JSON payload. omarchy plugin list then dies on jq: parse error: Invalid numeric literal at line 1, column 2, and omarchy plugin list --json serves the poisoned payload to every consumer (see #15834).

Fix

bin/omarchy-plugin-list now skips to the first line that starts the JSON array before using the payload, mirroring the consumer-side lesson from #6378 (fix the shipped consumer rather than wait for the producer's upstream). A call that never produces a payload now fails with a clear "omarchy-shell returned no plugin list" message instead of a jq parse error or a silently empty plugin list.

The root cause lives in the qs ipc client (Quickshell), so the preamble itself is worth reporting upstream too; this keeps the shipped consumers working meanwhile.

Test

New test/shell.d/plugin-list-locale-warning-test.sh stubs omarchy-shell to emit the exact Qt 6.12 warning preamble ahead of a plugin list and asserts:

  • the table still lists the plugin
  • --json output starts with the payload, not the warning
  • a clean payload keeps working unchanged
  • a payload that never arrives is an error, not an empty list

Verified it fails without the fix (jq parse error, exit 5) and passes with it.

Fixes #15834

The qs ipc client prints Qt diagnostics on stdout; since Qt 6.12 the
non-UTF-8 locale warning lands there ahead of the listPlugins JSON, so
omarchy plugin list dies on a jq parse error and --json serves a
poisoned payload. Skip to the JSON array, and fail with a clear message
when no payload ever arrives instead of reporting an empty plugin list.

Fixes omacom#15834
@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous test finding fully addressed.

Summary

omarchy-plugin-list skips Qt warning lines before the JSON array and reports an error when no array arrives.

  • Plugin lists skip Qt warnings before returning their JSON or table.

Reviews (2) · Last reviewed commit: "Test the clean plugin list without the w..." · Reviewed by Greptile

The clean-payload case swapped only the plugin data and kept the stub that prints the Qt locale warning, so it ran the warning case a second time and a change that broke output with no preamble would still have passed. Give that case a stub that prints the payload alone, and check --json as well as the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the bug Something isn't working label Oct 19, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @AnPod. I reviewed it on an Omarchy worker (Qt 6.12.0, quickshell 0.3.2, session locale POSIX), and the bug is real: qs ipc prints Qt's "Detected locale "C" ... not UTF-8" warning on stdout ahead of the reply. On quattro it only reaches callers on the fallback path, though. omarchy-shell answers over the shell's own socket first (#13435), and that reply is clean, so omarchy plugin list works on quattro while the shell is running. 4.0.5 doesn't have the socket yet, which is why the report hits it every time. With the socket hidden, so omarchy-shell falls back to qs ipc, the base script exits 5 with the jq parse error and this branch lists the plugins. ./test/cli and the plugin shell tests pass on the head (plugins-test.sh could not run because the worker has no node).

I pushed one test-only commit (6c81cc1). The "clean payload" case still used the stub that prints the warning, so it repeated the warning case, as Greptile pointed out. It now prints the payload alone and checks --json too. A mutant of the script that only handles a two-line preamble passes the old test and fails the new one.

There is an older open fix for the same bug: #15128 runs the qs ipc fallback inside omarchy-shell under LC_ALL=C.UTF-8, so the warning is never printed. That covers this command, and on the same fallback it also covers omarchy plugin remove (bin/omarchy-plugin-remove:75 feeds the reply to jq and fails the same way), omarchy bar put, and omarchy-shell's own error matching, which currently exits 0 on "Function not found." once the warning comes first. I checked on the worker that LC_ALL=C.UTF-8 qs ipc ... listPlugins returns the bare JSON. Since #15128 came first and also fixes the shared cause, it is the one to land, and this pull request is left to the maintainer to close or keep. The explicit "returned no plugin list" error here is a fair check, but with the warning gone it guards a case nothing currently produces.

The second opinion was Codex Medium. It reviewed this branch and found no defect. Asked separately which of the two should land, it chose #15128 for the same reasons; it agreed with my reading rather than reaching it independently, since independence is not guaranteed. This now waits on the maintainer.

AnPod commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by the older #15128.

@AnPod AnPod closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qs ipc client writes Qt diagnostics to stdout, breaking omarchy plugin list and JSON consumers (Qt 6.12 locale warning)

2 participants